/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package sios.modelo.service.impl;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sios.modelo.dao.Hisc_historialSiosDao;
import sios.modelo.dao.QuerySQLServerDAO;
import sios.modelo.service.Hisc_historialSiosService;

/**
 *
 * @author jorgegfx
 */
@Service("hisc_historialSiosService")
@Transactional("transactionManagerSios")
public class Hisc_historialSiosServiceImpl implements Hisc_historialSiosService {

    private static final Logger Log
            = Logger.getLogger(Hisc_historialSiosServiceImpl.class);

    private String limit;

    @Autowired
    private Hisc_historialSiosDao historialSiosDao;
    private QuerySQLServerDAO querySQLServerDAO;
    
    public Hisc_historialSiosDao getHistorialSiosDao() {
        return historialSiosDao;
    }

    public void setHistorialSiosDao(Hisc_historialSiosDao historialSiosDao) {
        this.historialSiosDao = historialSiosDao;
    }
    
    public QuerySQLServerDAO getQuerySQLServerDAO() {
        return querySQLServerDAO;
    }

    public void setQuerySQLServerDAO(QuerySQLServerDAO querySQLServerDAO) {
        this.querySQLServerDAO = querySQLServerDAO;
    }

    @Override
    public int consultar_historial(Map<String, Object> parametros) {
        Integer result = getHistorialSiosDao().consultar_historial(parametros);
        return (result != null ? result : 0);
    }

    @Override
    public Integer cantidadHistoriasId(String id, String via_sios) {
        return getQuerySQLServerDAO().cantidadHistoriasId(id, via_sios);
    }

    @Override
    public Integer cantidadHistoriasIdFecha(String id, String via_sios,
            Timestamp fecha) {
        return getQuerySQLServerDAO().cantidadHistoriasIdFecha(
                id, via_sios, fecha);
    }

    @Override
    public List<Map<Object, Object>> listar(Map<String, Object> parameters) {
        return getQuerySQLServerDAO().listarHistorias(parameters);
    }

    @Override
    public Map<Object, Object> consultarHistoria(String id) {
        return getQuerySQLServerDAO().consultarHistoria(id);
    }

    @Override
    public String getLimit() {
        return limit;
    }

    @Override
    public void setLimit(String limit) {
        this.limit = limit;
    }
}
